# coding: utf-8
# @Author: 吴启新

from src.file.selector import get_user_choice
from src.excel.writer import process_contribution_generation


def main():
    print("程序开始运行")
    selected_file = get_user_choice()

    if selected_file:
        print(f"继续处理文件: {selected_file}")
        # 生成贡献度文件
        success = process_contribution_generation(selected_file)
        if success:
            print("贡献度文件生成成功")
        else:
            print("贡献度文件生成失败")
            exit(1)
    else:
        print("错误: 未选择有效文件，程序退出")
        exit(1)


if __name__ == "__main__":
    main()